ci: fix version-sync assertion (no-op rewrite is fine)#150
Merged
Conversation
The version-sync step asserted `new != s`, which fires when parent and example versions already agree (the rewrite is an identity no-op, no content change). Post-merge run on main hit this immediately because the parent is at 6.1.0 and the example was already pinned to 6.1.0. Use re.subn to count matches and assert count >= 1 — a no-op rewrite when versions match is the expected steady state; a zero-match means the pom layout drifted and CI should fail loud.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Post-merge run of #149 on main hit the version-sync assertion immediately:
```
AssertionError: Failed to rewrite example pom version
```
The assertion was `assert new != s` — fires when parent and example versions already agree (rewrite is an identity no-op). The parent is at 6.1.0 and the example was already pinned to 6.1.0, so the regex matched 1 occurrence but the content was unchanged.
Fix
Use `re.subn` to count matches and assert `count >= 1`. A no-op rewrite (versions already match) is the expected steady state; a zero-match means the pom layout drifted and CI should fail loud.
Test plan